package com.ntv.persistent.news.sql.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.ntv.domain.INewsType;
import com.ntv.domain.NewsType;

public class NewsTypeMapper implements RowMapper 
{
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException 
	{
		INewsType newstype  = new NewsType();
		newstype.setTypeId(rs.getLong("TYPE_ID"));
		newstype.setName(rs.getString("NAME"));
		newstype.setDescription(rs.getString("DESCRIPTION"));	
		newstype.setCreatedBy(rs.getLong("CREATED_BY"));
		newstype.setDateOfCreation(rs.getDate("DATE_OF_CREATION"));

		newstype.setUpdatedBy(rs.getLong("UPDATED_BY"));
		newstype.setDateOfUpdation(rs.getDate("DATE_OF_UPDATE"));
		return newstype;
	}
}